<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.util.*,java.text.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
<script>
  function doCount(){
	  <%
	    //System.out.println("按钮被点击了额");
	    out.print("alert('按钮被点击了额');");
	  %>
  }
</script>
</head>
<body>
<%!
  static int count=0;
  static SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
  public String dateToString(Date d){
	return df.format(d);
  } 
%>

<%
//jspService
count++;
  Date date=new Date();
String str=dateToString(date);
 
%>
<h1><%=str%></h1>
<h1>访问了<%=count%>次</h1>
<div>
 <%out.println(count+"<br/>"); %>
 nihao
</div>
<input type="button" value="click" onclick="doCount()"/>
</body>
</html>